package com.example.weixin_01.test.design_model.responsibility;


import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.Reader;

/**
 * @author zhenghuisheng
 * @date : 2022/9/16
 */
public class MybatisSource {
    public static void main(String[] args) throws IOException {

        String resource = "mybatis-config.xml";
        Reader reader;
        //将XML配置文件构建为Configuration配置类
        reader = Resources.getResourceAsReader(resource);
        //解析环境，xml配置文件，xml映射文件等,解析的信息存入到这个Configuration的配置类里面
        //先后面会通过一个Configuration的配置类创建一个SqlSessionFactory的会话
        SqlSessionFactory build = new SqlSessionFactoryBuilder().build(reader);

    }
}
